package dmp.utils

object RptUtils {
  // 处理 原始请求数，有效请求，广告请求
  def calculateReq(reqMode:Int,prcMode:Int):List[Double]={
    if(reqMode == 1 && prcMode ==1){
      List[Double](1,0,0)
    }else if(reqMode == 1 && prcMode == 2){
      List[Double](1,1,0)
    }else if(reqMode == 1 && prcMode == 3){
      List[Double](1,1,1)
    }else{
      List[Double](0,0,0)
    }
  }
  // 参与竞价数，竞价成功数，广告消费 ，广告成本
  def caculateRtb(fective:Int,bill:Int,bid:Int,
                  win:Int,adorderid:Int,winPrice:Double,adPayment:Double):List[Double]={
    if(fective ==1 && bill == 1 && bid ==1){
      List[Double](1,0,0,0)
    }else if(fective ==1 && bill == 1 && win == 1 && adorderid != 0){
      List[Double](0,1,winPrice/1000.0,adPayment/1000.0)
    }else{
      List[Double](0,0,0,0)
    }
  }
  // 展示数，点击数
  def calculateTimes(reqMode:Int,fective:Int):List[Double]={
    if(reqMode ==2 && fective == 1){
      List[Double](1,0)
    }else if(reqMode == 3 && fective == 1){
      List[Double](0,1)
    }else{
      List[Double](0,0)
    }
  }
}
